package com.bbs.core.controller;



import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.bbs.core.model.User;
import com.bbs.core.service.UserService;

/**
 * Created by Administrator on 2017/8/16.
 */
@Controller
public class UserController {
	
	@Autowired
	private UserService userService;
	
	@RequestMapping("/bbs/user/{id}")
	public ModelAndView saveUser(ModelAndView view, @PathVariable int id){
		view.setViewName("/bbs/user/user.html");
		User user = userService.selectByPrimaryKey(id);
		view.addObject("user", user);
		return view;
	}

   
}